﻿using Plugin.BLE.Abstractions.Contracts;
using RaceHFTools.BluetoothLE.Bean.Module;
using System.Threading.Tasks;

namespace RaceHFTools.BluetoothLE.Bean
{
    public class Bean : Product
    {
        public uint LastPowerUtc;

        public Upgrade Upgrade { get; private set; }
        public Fsync Fsync { get; private set; }
        public Tweak Tweak { get; private set; }
        public Info Info { get; private set; }

        public Bean(Controller controller, IDevice target) : base(controller, target)
        {

        }

        public override async Task PreInit()
        {
            await base.PreInit();

            Upgrade = new Upgrade(this);
            Fsync = new Fsync(this);
            Tweak = new Tweak(this);
            Info = new Info(this);

            await Tweak.Init();
        }
    }
}
